package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.query.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    int queryForCount(EmployeeQueryObject qo);

    List<Employee> queryForList(EmployeeQueryObject qo);

    /**
     * 改变员工状态
     * @param id 员工的id
     */
    void changeState(Long id);

    /**
     * 维护与角色的关系
     */
    void deleteRelation(Long id);

    void saveRelation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);

    Employee getEmployeeByUsername(String username);

    List<Employee> listData();

}